const code =`
<template>
    <!--<input type="text" v-model="input" placeholder="请输入内容">-->
   <el-input ref="cell-input" autofocus size="small" v-model="input" placeholder="请输入内容"></el-input>
</template>
<script>
   export default {
        props: {
            comp: {
                type:  [Function, Object]
             }
        },
        data() {
             return {
                 input: this.comp.data
             }
        },
        mounted() {
            this.$nextTick(() => {
                // console.log('open el-input.js')
                let cellInput = this.$refs['cell-input']
                setTimeout(() => { // setTimeout解决不能定位焦点问题
                    if(cellInput){
                        cellInput.select()
                        cellInput.focus()
                    }
                })
                
            })
        },
        watch:{
           input : {
              handler (val, oldVal) {
                this.$emit('global:CELL_EDIT_TABLE', val )
              },
              immediate: true,
            }
        },
        methods: {
            
        },
        beforeDestroy(){
            // console.log('bye bye el-input.js')
            this.$emit('global:CELL_EDIT_TABLE_BYE', true);
        }
    }
</script>`;

export default code;
